package com.itcoon.cloud.framework.mybatis.typehandler;

import com.fasterxml.jackson.core.type.TypeReference;
import com.itcoon.cloud.framework.enums.ValueEnum;

import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.Collection;

public class ValueEnumCollectionToJsonTypeHandler<V extends Serializable, E extends Enum<E>& ValueEnum<V, E>> extends TypeReferenceToJsonTypeHandler<Collection<E>> {

    public ValueEnumCollectionToJsonTypeHandler(Class<E> enumType) {
        super(new TypeReference<Collection<E>>() {
            @Override
            public Type getType() {
                return enumType;
            }
        });
    }
}
